﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="InlineXhtmlEditor.ascx.cs" Inherits="LCA.Admin.FormControls.InlineXhtmlEditor" %>

<ui:htmldatadialog 
	formattingconfiguration="common"
	elementclassconfiguration="common" 
    embedablefieldstypenames=""
	configurationstylesheet="<%= Composite.Core.WebClient.UrlUtils.ResolvePublicUrl( "Frontend/Styles/VisualEditor/VisualEditor.Config.css" ) %>"  
	presentationstylesheet="<%= Composite.Core.WebClient.UrlUtils.ResolvePublicUrl( "Frontend/Styles/VisualEditor/VisualEditor.Default.css" ) %>"   
	value="<%= HttpContext.Current.Server.UrlEncode(_currentStringValue).Replace("+", "%20") %>"
	id="<%= this.ClientID %>"
	name="<%= this.ClientID %>"
	callbackid="<%= this.ClientID %>"/>

<script type="text/javascript">
//<![CDATA[
    $(window).load(function () {

        $('input#<%= this.ClientID %>').val(bindingMap.<%= this.ClientID %>.getValue());

        bindingMap.<%= this.ClientID %>.addActionListener(PageBinding.ACTION_DOPOSTBACK);
        bindingMap.<%= this.ClientID %>.handleAction = function (args) {
            HTMLDataDialogBinding.prototype.handleAction.call(this, args);
            switch (args.type) {
                case PageBinding.ACTION_DOPOSTBACK:
                    $('input#<%= this.ClientID %>').val(bindingMap.<%= this.ClientID %>.getValue());
                    args.consume();
                    break;
            }
        };
        bindingMap.<%= this.ClientID %>.handleBroadcast=function(msg,arg){
            switch(msg){
                case BroadcastMessages.KEY_SPACE:
                    //this.fireCommand();
                    break;
                default:
                    DataDialogBinding.prototype.handleBroadcast.call(this,msg,arg);
                    break;
            }
        };

    });
//]]>
</script>
